interface Calculate {
  add(a: number, b: number): number
}

declare let calculate: Calculate;
declare let Java: any;

const test = function (a: number, b: number): number {
  return calculate.add(a, b);
}

const test2 = function (a: number, b: number): number {
  return Java.type("org.demo.graaljs.test.Calculate").Instance.add(a, b);
}

const test3 = function (fuc: Function) {
  return fuc.apply(null, [1, 2]);
}

const test4 = function (a: number, b: number): number {
  return a + b;
}

const x ={
  a: 1,
  b: 2,
};

const test5 = function (x: any): number {
  return x.a + x.b;
}

export {
  test,
  test2,
  test3,
  test4,
  x,
  test5,
  calculate,
}
